    let context = $("#lineChart").get(0).getContext('2d');
    let chartData = $('#data').data('chart_data')
	console.log(chartData.labels)
    var chart = new Chart(context, {
        type: 'bar',
        data: {
            labels: chartData.labels,
            datasets: [
                {
                    label: "Новых пользователей",
                    data: chartData.registrationsCount,
                    fill: true,
                    lineTension: 0.2,
                    backgroundColor: "rgba(54, 162, 235, 0.5)",
                    borderColor: "rgb(54, 162, 235)",
                    borderWidth: 1.2
                },
            ]
        },
        options: {
            responsive: true
        },
    })

    $("#changeDateButton").click(() => {
        let data = {date_from: $('#datefrom').val(), date_to: $('#dateto').val()};
        var chart_data = $.post("/admin", data)
        chart_data.done(function(chartData) {
			chartData = JSON.parse(chartData)
			chart.data.labels = chartData.labels
			chart.data.datasets[0].data = chartData.registrationsCount
            chart.update();
        });
    });

